/*
 * LogLevelEnum.cpp
 *
 */

#include "LogLevelEnum.h"

using namespace std;

const std::string LogLevelEnum::TRACE_TEXT = "TRACE";
const std::string LogLevelEnum::DEBUG_TEXT = "DEBUG";
const std::string LogLevelEnum::INFO_TEXT = "INFO";
const std::string LogLevelEnum::WARN_TEXT = "WARN";
const std::string LogLevelEnum::ERROR_TEXT = "ERROR";
const std::string LogLevelEnum::FATAL_TEXT = "FATAL";
const std::string LogLevelEnum::OFF_TEXT = "OFF";

LogLevelEnum::LogLevelEnum():m_Level(DEBUG)
{

}

LogLevelEnum::~LogLevelEnum()
{

}

std::string LogLevelEnum::toString(int value)
{
	string retStr;

	switch(value)
	{
	case DEBUG:
		retStr = DEBUG_TEXT;
		break;
	case ERROR:
		retStr = ERROR_TEXT;
		break;
	case FATAL:
		retStr = FATAL_TEXT;
		break;
	case INFO:
		retStr = INFO_TEXT;
		break;
	case TRACE:
		retStr = TRACE_TEXT;
		break;
	case OFF:
		retStr = OFF_TEXT;
		break;
	}

	return retStr;
}

std::string LogLevelEnum::extractString()
{
	return toString(m_Level);
}
